/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.rm.entidades;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * 
 * @author ffbeltran
 */
@Entity
@Table(name = "exp_hechizo")
@NamedQueries( {
		@NamedQuery(name = "ExpHechizo.findAll", query = "SELECT e FROM ExpHechizo e"),
		@NamedQuery(name = "ExpHechizo.findById", query = "SELECT e FROM ExpHechizo e WHERE e.id = :id"),
		@NamedQuery(name = "ExpHechizo.findByJugador", query = "SELECT e FROM ExpHechizo e WHERE e.jugador = :jugador"),
		@NamedQuery(name = "ExpHechizo.findByPp", query = "SELECT e FROM ExpHechizo e WHERE e.pp = :pp"),
		@NamedQuery(name = "ExpHechizo.findByIdPartida", query = "SELECT e FROM ExpHechizo e WHERE e.idPartida = :idPartida"),
		@NamedQuery(name = "ExpHechizo.findByCompartido", query = "SELECT e FROM ExpHechizo e WHERE e.compartido = :compartido") })
public class ExpHechizo extends ExperienciaBase {
	private static final long serialVersionUID = 1L;

	@Basic(optional = false)
	@Column(name = "valor1")
	private int pp;

	public ExpHechizo() {
	}

	public ExpHechizo(Integer id) {
		super(id);
	}

	public int getPp() {
		return pp;
	}

	public void setPp(int valor1) {
        actualizaExp();
		this.pp = valor1;
	}

	@Override
	public String toString() {
		return "org.rm.entidades.ExpHechizo[id=" + super.getId() + "]";
	}

	@Override
	public void actualizaExp() {
		setExp(pp);
	}

}
